home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Online / Epic4 / share / epic / help / 6_functions / copattern < prev    next >
Text File  |  2001-03-21  |  1KB  |  34 lines

  1. Synopsis:
  2.    $copattern(<pattern> <var1> <var2>)
  3.  
  4. Technical:
  5.    Given a pattern and two variable names that represent lists of words of
  6.    the same length, for every word in $var1 that is matched by the
  7.    specified pattern, the corresponding word in $var2 will be returned.
  8.    If the corresponding word in $var2 is absent (because $var2 is too
  9.    short), then the empty string is substituted (i.e., nothing is returned
  10.    for that word.)
  11.  
  12. Practical:
  13.    When you have two variables, one that contains a list of control data,
  14.    and another that contains a list of secondary data, and you wish to
  15.    retrieve the secondary data, but you need to do it based on a query of
  16.    the control data, you might use this function.  One possible use might
  17.    be if one variable held your friends list, and another held their access
  18.    levels.
  19.  
  20. Returns:
  21.    word in var2 corresponding to indexed word in var1
  22.  
  23. Examples:
  24.    @ friends = [bob@foo.com tom@bar.com]
  25.    @ levels  = [20 10]
  26.    $copattern(*@foo.com friends levels)       returns "20"
  27.    $copattern(*@bar.com friends levels)       returns "10"
  28.    $copattern(*@*.com friends levels)         returns "20 10"
  29.    $copattern(*@*.net friends levels)         returns ""  (empty string)
  30.  
  31. See also:
  32.    match(6); word(6)
  33.  
  34.